package com.example.demo.common.msg.vo;

/**
 * ${Description}
 *
 * @author: fuqiangnian
 * created: 17/9/7 上午11:52
 */
public class EbsMessageReceiver {

     private String email;

     private String mobile;

     private Integer userId;

     public EbsMessageReceiver() {}

     public EbsMessageReceiver(String email, String mobile, Integer userId) {
          this.email = email;
          this.mobile = mobile;
          this.userId = userId;
     }

     public String getEmail() {
          return email;
     }

     public void setEmail(String email) {
          this.email = email;
     }

     public String getMobile() {
          return mobile;
     }

     public void setMobile(String mobile) {
          this.mobile = mobile;
     }

     public Integer getUserId() {
          return userId;
     }

     public void setUserId(Integer userId) {
          this.userId = userId;
     }


     @Override
     public int hashCode() {
          int result = 17;
          result = 31* result + (userId!=null?userId:0);
          result = 31* result + (mobile!=null?mobile.hashCode():0);
          result = 31* result + (email!=null?email.hashCode():0);

          return result;
     }

     @Override
     public boolean equals(Object obj) {
          if(obj == null) return false;

          if(!(obj instanceof EbsMessageReceiver )) return false;

          EbsMessageReceiver receiver = (EbsMessageReceiver)obj;

          if(receiver == this) return  true;

          if(userId != null && userId.equals(receiver.userId)){
               return  true;
          }

          if(email != null && email.equals(receiver.email)){
               return  true;
          }
          if(mobile != null && mobile.equals(receiver.mobile)){
               return  true;
          }

          return false;
     }

     @Override
     public String toString() {
          return "{email:"+email+",mobile:"+mobile+",userId:"+userId+"}";
     }
}
